﻿<div style="width: 100%" class="text-center">
    <div style="width: 600px;height: 338px; background-color: #000000"
         class="mx-auto">
        <MXgplayer Url="@("https://img-cdn.lonsid.cn/download/1602691659.mp4")"
                   Width="@("100%")"
                   Height="@("100%")"
                   @ref="@_xgplayer">
            <MXgplayerControls InitShow AutoHide="false"/>
        </MXgplayer>
    </div>

    <MButton Class="mt-1" Color="primary" OnClick="@ToggleToMusic">Toggle to Music</MButton>
    <MButton Class="mt-1" Color="primary" OnClick="@ToggleToVideo">Toggle to Video</MButton>
</div>

@code {

    private MXgplayer _xgplayer = null!;

    private async Task ToggleToMusic()
    {
        await _xgplayer.ToMusicPlayerAsync();
    }

    private async Task ToggleToVideo()
    {
        await _xgplayer.ToVideoPlayerAsync();
    }

}
